package edu.pku.sei.act.autonomicParkingSlot.Car;

import edu.pku.sei.act.actools.util.env.ITuple;

public class TaskMessage implements ITuple {
	
	private String receiver;
	private String topic;
	private String content;

	public String getReceiver() {
		return receiver;
	}

	public void setReceiver(String receiver) {
		this.receiver = receiver;
	}

	public String getTopic() {
		return topic;
	}

	public void setTopic(String topic) {
		this.topic = topic;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Override
	public String toTuple() {
		String tuple = "";
		if(receiver == null)
			tuple += "null^";
		else
			tuple = tuple + receiver + "^";
		
		if(topic == null)
			tuple += "null^";
		else
			tuple = tuple + topic + "^";
		
		if(content == null)
			tuple += "null";
		else
			tuple += content;
		return tuple;
	}

	@Override
	public String toTemplate() {
		String template = "";
		if(receiver == null)
			template += "%^";
		else
			template = template + receiver + "^";
		
		if(topic == null)
			template += "%^";
		else
			template = template + topic + "^";
		
		if(content == null)
			template += "%";
		else
			template += content;
		return template;
	}

}
